<layout name="layout" /> 
<div id="category">
	<div class="row">
		<div class="col-md-4">

			<h3>添加分类</h3>
			<form class="form-horizontal" role="form" action="__CONTROLLER__/add" method="post">
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="name"> 分类名 </label>

					<div class="col-sm-9">
						<input type="text"  name="name" id="name" placeholder="分类标题" class="col-xs-10 col-sm-5">
					</div>
				</div>
				
				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="slug"> 分类别名 </label>

					<div class="col-sm-9">
						<input type="text" name="slug" id="slug" placeholder="建议输入英文或数字" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="pid"> 父级 </label>
					<div class="col-sm-9">
						<select name="pid" id="pid" class="postform">
							<option value="0">无</option>
							<foreach name="cate" item="v">
								<option value="{$v.id}">{$v.html}{$v.name}</option>
							</foreach>
						</select>
					</div>
				</div>
				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="keywords"> 关键词 </label>
					<div class="col-sm-9">
						<input type="text" name="keywords" id="keywords" placeholder="多个关键词用','隔开" class="form-control">
					</div>
				</div>

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="description"> 描述信息 </label>
					<div class="col-sm-9">
						<textarea id="description" name="description" class="autosize-transition form-control" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 52px;"></textarea>
					</div>
				</div>

				<div class="space-4"></div>

				<div class="clearfix form-actions">
					
						<div class="row">
							<div class="col-md-6 col-xs-6 col-sm-6" style="text-align:center;">
								<button class="btn btn-info" type="submit">
									<i class="ace-icon fa fa-check bigger-110"></i>
									提交
								</button>												
							</div>
							<div class="col-md-6 col-xs-6 col-sm-6" style="text-align:center;">
								
								<button class="btn" type="reset">
									<i class="ace-icon fa fa-undo bigger-110"></i>
									重置
								</button>
							</div>
						</div>
				</div>
			</form>		
		</div>
		<div class="col-md-8">
			<h3>分类列表</h3>
			<table id="sample-table-1" class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>ID</th>
						<th>名称</th>
						<th>别名</th>
						<th>文章</th>
						<th>操作</th>
					</tr>
				</thead>

				<tbody>
				<foreach name="cate" item="v">
					<tr class="selected">
						<td style="width:10%">{$v.id}</td>
						<td style="width:50%">{$v.html}{$v.name}</td>
						<td style="width:10%">{$v.slug}</td>
						<td style="width:10%"><php>echo get_cate_article($v['id']) </php></td>
						<td style="width:20%">
							<div class="hidden-sm hidden-xs btn-group">
								<a class="btn btn-xs btn-info" href="__CONTROLLER__/edit?id={$v.id}">
									<i class="ace-icon fa fa-pencil bigger-120"></i>
								</a>

								<a class="btn btn-xs btn-danger" href="__CONTROLLER__/del?id={$v.id}">
									<i class="ace-icon fa fa-trash-o bigger-120"></i>
								</a>
								<a href="__MODULE__/Menu/add?cate_id={$v.id}" title="添加至菜单" class="btn btn-xs btn-success">
									<i class="ace-icon fa fa-plus bigger-120"></i>
								</a>								
							</div>

							<div class="hidden-md hidden-lg">
								<div class="inline position-relative">
									<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
										<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
									</button>

									<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">


										<li>
											<a href="__CONTROLLER__/edit?id={$v.id}" class="tooltip-success" data-rel="tooltip" title="" data-original-title="Edit">
												<span class="green">
													<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
												</span>
											</a>
										</li>

										<li>
											<a href="__CONTROLLER__/del?id={$v.id}" class="tooltip-error" data-rel="tooltip" title="" data-original-title="Delete">
												<span class="red">
													<i class="ace-icon fa fa-trash-o bigger-120"></i>
												</span>
											</a>
										</li>
									</ul>
								</div>
							</div>
						</td>
					</tr>
				</foreach>
				</tbody>
			</table>
		</div>
	</div>
</div>